<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>透明的单例类的编写优化版</title>
</head>
<body>
<script>
var MYApp ={};
MYApp.namespace = function (name) {
    var parts = name.split('.');
    var current = MYApp;
    for (var i in parts){
        if(!current[parts[i]]){
            current[parts[i]] = {};
        }
        current = current[parts[i]];
    }
};
MYApp.namespace('event')
    MYApp.namespace('dom.style');
console.dir(MYApp);
var languages = [
    { name: "JavaScript", fileExtension: ".js" },
    { name: "TypeScript", fileExtension: ".ts" },
    { name: "CoffeeScript", fileExtension: ".coffee" }
];

console.table(languages);

var name = {}
console.dir(typeof languages)
</script>
</body>
</html>